<%-- 
    Document   : ListaPracticas
    Created on : 11-ago-2013, 14:47:22
    Author     : kriss
--%>

<%@page import="Bean.Practica"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="Bean.Dispositivo"%>
<%@page import="Bean.Usuario"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%
    String context = request.getContextPath();
    HttpSession sesion = request.getSession();
    List<Practica> list = new ArrayList<Practica>();
    
    list = (ArrayList<Practica>) request.getAttribute("lista");
    
    Usuario login = new Usuario();
    if (sesion.getAttribute("login") == null) {
        response.sendRedirect(context + "/ServletLogin");
    } else {
        login = (Usuario) sesion.getAttribute("login");
    }
%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">
    <head>
        <!--  Created by Artisteer v3.0.0.32906  Base template (without user's data) checked by http://validator.w3.org : "This page is valid XHTML 1.0 Transitional"  -->
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <%=request.getContextPath()%>
        <title>Sistema de Control de Reservaciones CCS</title>
        <link rel="stylesheet" href="<%=request.getContextPath()%>/css/style.css" type="text/css" media="screen" />
        <link href="<%=request.getContextPath()%>/menu_assets/styles.css" rel="stylesheet" type="text/css">

        <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/js/script.js"></script>
        
    </head>
    <body>



        <div id="art-page-background-glare">
            <div id="art-page-background-glare-image">
                <div id="art-main">
                    <div class="art-sheet">

                        <div class="art-sheet-body">
                            <div class="art-header">
                                <div class="art-header-center">
                                    <div class="art-header-png"></div>
                                    <div class="art-header-jpeg"></div>
                                </div>
                                <div class="art-logo">
                                    <h1 id="name-text" class="art-logo-name"><a href="../index.html"></a></h1>
                                    <h2 id="slogan-text" class="art-logo-text"></h2>
                                </div>
                            </div>
                            <div class="art-nav">
                                <div class="l"></div>
                                <div class="r"></div>
                                <ul class="art-menu">
                                </ul>
                            </div>
                            <div class="art-content-layout">
                                <div class="art-content-layout-row">
                                    <div class="art-layout-cell art-sidebar1">
                                        <div id='cssmenu'>
                                            <ul>
                                                <li class='active'><a href='#'><span>Usuarios</span></a></li>
                                                <li><a href='<%=context%>/ControladorDispositivos?accion=Consultar'><span>Equipo</span></a></li>
                                                <li><a href='#'><span>Aulas</span></a></li>
                                                <li><a href='#'><span>Reservaciones</span></a></li>
                                                <li><a href="<%=context%>/ControladorProfesor?accion=Consultar"><span>Profesores</span></a></li>
                                                <li><a href='#'><span>seis</span></a></li>
                                            </ul>
                                        </div>



                                    </div>
                                    <div class="art-layout-cell art-content">

                                        <div class="art-post">
                                            <div class="art-post-body">
                                                
                                                    
                                                
                                                <span class="art-button-wrapper" style="margin-left:600px; margin-top:10px;">
                                                    
                                                    <span class="art-button-l"> </span><span class="art-button-r"> </span>
                                                    <a  class="art-button"  href="<%=context%>/ServletLogin?accion=cerrarSesion">Cerrar Sesión</a>
                                                </span>

                                                <div class="art-post-inner art-article">
                                                    <div class="art-postmetadataheader">

                                                        <h2 class="art-postheader">Lista de dispositivos</h2>
                                                    </div>
                                                    <div class="art-postcontent">
                                                        <table id="demo">
                                                            <th>Mostrar</th>
                                                             <th>No de practica</th>
                                                             <th>Imagen</th>
                                                             <th>Descripcion</th>
<!--                                                             <th>cantidad</th>-->
                                                             <th>t</th>
                                                             <th>Eliminar</th>
                                                            <%for (Practica disp : list) {%>
                                                            <tr>
                                                            
                                                                <td id="<%=disp.getId()%>" onclick="editar(this.id);">
                                                                    Modificar
                                                                </td>
                                                                <td >
                                                                    <%=disp.getNumero_practica()%>
                                                                </td>
                                                                <td>
                                                                    <%=disp.getImagen()%>
                                                                </td>
                                                                <td>
                                                                    <%=disp.getDescripcion()%>
                                                                </td>
<!--                                                                <td>
                                                                    <%=disp.getDesarrollo()%>
                                                                </td>-->
                                                                <td>
                                                                    <%=disp.getSoftware()%>
                                                                </td>
                                                                <td>
                                                                    <%=disp.getConfiguracion_script()%>
                                                                </td>
                                                                
                                                                <td id="<%=disp.getId()%>" onclick="eliminar(this.id);">
                                                                    Eliminar
                                                                </td>
                                                                <%}%>
                                                            </tr>

                                                            
                                                        </table>
                                                            <form id="uno" name="uno" action="<%=context%>/ControladorDispositivos" metod="post">
                                                            <input type="hidden" value="" id="id" name="id"/>
                                                            <input type="hidden" value="" id="accion" name="accion"/>
                                                            </form>
                                                     <span class="art-button-wrapper" style="margin-left:0px; margin-top:10px;">
                                                    
                                                    <span class="art-button-l"> </span><span class="art-button-r"> </span>
                                                    <a  class="art-button"  href="<%=context%>/Contenido/Practicas/PracticasForm.jsp">Agregar</a>
                                                </span>
                                                    </div>
                                                    <div class="cleared"></div>
                                                </div>
                                                <div class="cleared"></div>
                                            </div>
                                        </div>
                                        <div class="cleared"></div>
                                    </div>
                                </div>
                            </div>
                            <div class="cleared"></div>
                            <div class="art-footer">
                                <div class="art-footer-t"></div>
                                <div class="art-footer-l"></div>
                                <div class="art-footer-b"></div>
                                <div class="art-footer-r"></div>
                                <div class="art-footer-body">
                                    <div class="art-footer-text">

                                        <p>Universidad Tecnològica Emiliano Zapata Av.Universidad Tecnològica No.1, Col. Palo Escrito, C.P.62760, Emiliano Zapata, Morelos.</p>
                                        <p>Tel.(01777) 368-11-65 Ext.270 jonathanaguilar@utez.edu</p>
                                    </div>
                                    <div class="cleared"></div>
                                </div>
                            </div>
                            <div class="cleared"></div>
                        </div>
                    </div>
                    <div class="cleared"></div>

                </div>
            </div>
        </div>

    </body>
</html>
<script id="scriptInit" type="text/javascript">
    
    
  
    function editar(id){
        document.getElementById("id").value=id;
        document.getElementById("accion").value="Editar";

        document.uno.submit();
    }
    function eliminar(id)
    {
        document.getElementById("id").value=id;
        document.getElementById("accion").value="Eliminar";

        document.uno.submit();

    }
    
</script>
